<?php
namespace app\common\logic;

use app\common\model\Skill;
use think\Model;


class SkillForm extends Model
{
    public function saveChange($data){

        if(is_numeric($data['id'])){
            return $this->validate(true)->allowField(true)->save($data,[$this->getPk()=>$data['id']]);
        }else{

            return $this->validate(true)->allowField(true)->save($data);
        }
    }

    public function skill()
    {
        return $this->hasOne(Skill::class,'skill_id','skill_id');
    }


}